package org.example.springboot.controller;

import org.example.springboot.entity.ExpertChat;
import org.example.springboot.service.ExpertChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author reisen7
 * @date 2025/5/29 21:16
 * @description 
 */

@RestController
@RequestMapping("/api/expert-chats")
public class ExpertChatController {
    @Autowired
    private ExpertChatService expertChatService;

    @GetMapping
    public List<ExpertChat> getChatHistory(@RequestParam Long expertId, @RequestParam Long userId) {
        return expertChatService.getChatHistory(expertId, userId);
    }

    @PostMapping
    public ExpertChat sendMessage(@RequestBody ExpertChat chat) {
        return expertChatService.sendMessage(chat);
    }
} 